package com.shidaimanong.demo.lottery;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

/**
 * 学编程，关注：十代码农
 * 抖音、快手、B站、西瓜视频、今日头条
 */
public class LotteryDemo1 {

    public static void main(String[] args) {
        //读取文件中存放的所有人名
        List<String> nameList = Arrays.asList("赵丽颖", "热巴", "杨颖", "杨幂", "项思醒", "孙一宁");
        //生成随机数
        Random random = new Random();
        int randomIndex = random.nextInt(nameList.size());
        //打印随机选中的人名
        System.out.println(nameList.get(randomIndex));
    }
}